﻿using System.Configuration;
using System.Data;
using System.Windows;

namespace WpfApp2NewWindows;

/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
    protected override void OnStartup(StartupEventArgs e)
    {
        //base.OnStartup(e);
        string text = "hello, default!";
        if (e.Args.Length > 0)
            text = e.Args[0];

        var win = new MainWindow(text);
        win.Show();

        Window mainWindow = null;
        // check some state or setting as appropriate
        if (ConfigurationManager.AppSettings["AdvanceMode"] == "1")
            mainWindow = new OtherWindow();
        else
            mainWindow = new MainWindow();

        mainWindow.Show();
    }
}

